package com.bite.springioc.Component;

import com.bite.springioc.Model.UserInfo;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Component;

@Component
public class UserComponent {

    //@Primary
    @Bean
    public UserInfo user1(){
        UserInfo user = new UserInfo();
        user.setId(1);
        user.setName("zhangsan");
        return user;
    }


    @Bean
    public UserInfo user2(){
        UserInfo user = new UserInfo();
        user.setId(2);
        user.setName("lisi");
        return user;
    }

    public void doComponent(){
        System.out.println("do Component---");
    }
}
